package cn.kgc.mes.service.impl;

import java.util.List;
import cn.kgc.mes.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.kgc.mes.mapper.CheckRecordMapper;
import cn.kgc.mes.domain.CheckRecord;
import cn.kgc.mes.service.ICheckRecordService;

/**
 * 设备点检记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-16
 */
@Service
public class CheckRecordServiceImpl implements ICheckRecordService 
{
    @Autowired
    private CheckRecordMapper checkRecordMapper;

    /**
     * 查询设备点检记录
     * 
     * @param recordId 设备点检记录主键
     * @return 设备点检记录
     */
    @Override
    public CheckRecord selectCheckRecordByRecordId(Long recordId)
    {
        return checkRecordMapper.selectCheckRecordByRecordId(recordId);
    }

    /**
     * 查询设备点检记录列表
     * 
     * @param checkRecord 设备点检记录
     * @return 设备点检记录
     */
    @Override
    public List<CheckRecord> selectCheckRecordList(CheckRecord checkRecord)
    {
        return checkRecordMapper.selectCheckRecordList(checkRecord);
    }

    /**
     * 新增设备点检记录
     * 
     * @param checkRecord 设备点检记录
     * @return 结果
     */
    @Override
    public int insertCheckRecord(CheckRecord checkRecord)
    {
        checkRecord.setCreateTime(DateUtils.getNowDate());
        return checkRecordMapper.insertCheckRecord(checkRecord);
    }

    /**
     * 修改设备点检记录
     * 
     * @param checkRecord 设备点检记录
     * @return 结果
     */
    @Override
    public int updateCheckRecord(CheckRecord checkRecord)
    {
        checkRecord.setUpdateTime(DateUtils.getNowDate());
        return checkRecordMapper.updateCheckRecord(checkRecord);
    }

    /**
     * 批量删除设备点检记录
     * 
     * @param recordIds 需要删除的设备点检记录主键
     * @return 结果
     */
    @Override
    public int deleteCheckRecordByRecordIds(Long[] recordIds)
    {
        return checkRecordMapper.deleteCheckRecordByRecordIds(recordIds);
    }

    /**
     * 删除设备点检记录信息
     * 
     * @param recordId 设备点检记录主键
     * @return 结果
     */
    @Override
    public int deleteCheckRecordByRecordId(Long recordId)
    {
        return checkRecordMapper.deleteCheckRecordByRecordId(recordId);
    }
}
